<!--{template /module/admin/view/head}-->
<div id="left_layout">
	<div id="main_content" class="container-fluid">
		<!--{template /module/admin/view/head_nav}-->
		<div class="row-fluid">
			<form method="post" action="{$ADMIN_SCRIPT}/join/{$dispatches[method]}&id={$_var[gp_id]}&page={$_var[page]}&psize={$_var[psize]}{$search[querystring]}" onsubmit="javascript:return check_form(this);">
			<input type="hidden" name="formsubmit" value="yes" />
				<div class="well widget">
					<div class="widget-header">
						<p class="text">* {lang admin.validate.require}</p>
					</div>
					<div class="widget-content">
						<fieldset>
						
							<label>{lang join.index_edit.view.title.label} *</label>
							<input type="text" class="input-xlarge"  name="txtTitle" placeholder="{lang join.index_edit.view.title.placeholder}..."  maxlength="50"  value="{$join[TITLE]}" />
							<span class="help-inline">{lang join.index_edit.view.title.tips}</span>
							
							<label>{lang join.index_edit.view.username.label}</label>
							<input type="text" class="input-medium"  name="txtUserName" maxlength="50"  value="{$join[USERNAME]}" />
							
							<label>{lang join.index_edit.view.connect.label}</label>
							<input type="text" class="input-large" name="txtConnect"  maxlength="50" value="{$join[CONNECT]}" /> 
							<hr/>
							
							<label>{lang join.index_edit.view.content.label} *</label>
							<textarea class="span12" rows="12" cols="45" name="txtContent" id="txt_content" style="height:300px;">{$join[CONTENT]}</textarea>							
							<span class="help-inline">{lang join.index_edit.view.content.tips}</span>
							<hr/>
							
							<label>{lang join.index_edit.view.result.label}</label>
							<textarea class="span8" rows="4" cols="45" name="txtRemark" >{$join[REMARK]}</textarea>
					   </fieldset>
					   
					   <hr/>
					   
					   <fieldset>
							<!--{if $dispatches['method'] == '_pub'}-->
							<button type="submit" class="btn btn-small btn-primary" {$dispatches[operations][add]}>{lang admin.operation.submit}</button>
							<!--{else}-->
							<button type="submit" class="btn btn-small btn-primary" {$dispatches[operations][edit]}>{lang admin.operation.submit}</button>
							<!--{/if}-->
							
							<button type="reset" class="btn btn-small">{lang admin.operation.reset}</button>
							<button type="button" class="btn btn-small" onclick="javascript:location.href='{$ADMIN_SCRIPT}/join&page={$_var[page]}&psize={$_var[psize]}{$search[querystring]}';">{lang admin.operation.go.back}</button>
						</fieldset>		            
					</div>
				</div>	
			</form>
		</div>
	</div>
</div> 

<script type="text/javascript" src="editor/kindeditor.js"></script>
<script type="text/javascript" src="editor/lang/zh_CN.js"></script>

<script>
function check_form(frm){
    if(frm.txtTitle.value.trim().length == 0){
    	$(frm.txtTitle).next('.help-inline').css('color', 'red');
    	frm.txtTitle.focus();
    	return false;
    }
    
    if(kindEditor.html().length == 0){
    	$(frm.txtContent).next('.help-inline').css('color', 'red');
    	kindEditor.focus();
    	return false;
    }
    
    return true;
}
    
$(function(){
	$('fieldset input,textarea,select').blur(function(){
		$(this).next('.help-inline').css('color', '#333');
	});
	
	kindEditor = KindEditor.create('#txt_content', kind_editor_onfig);
});
</script>
<!--{template /module/admin/view/foot}-->